package org.jeecg.modules.common.sensitive.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.common.sensitive.entity.SensitiveConfig;
import org.jeecg.modules.common.sensitive.mapper.SensitiveConfigMapper;
import org.jeecg.modules.common.sensitive.service.ISensitiveConfigService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 脱敏配置
 * @Author: jeecg-boot
 * @Date: 2022-06-14
 * @Version: V1.0
 */
@Service
public class SensitiveConfigServiceImpl extends ServiceImpl<SensitiveConfigMapper, SensitiveConfig> implements ISensitiveConfigService {

    @Override
    @Cacheable(value = "sensitive_config_list_cache", key = "#queryWrapper.getCustomSqlSegment()")
    public List<SensitiveConfig> list(Wrapper<SensitiveConfig> queryWrapper) {
        return super.list(queryWrapper);
    }

    @Override
    @Cacheable(value = "sensitive_config_single_cache", key = "#queryWrapper.getParamNameValuePairs()")
    public SensitiveConfig getOne(Wrapper<SensitiveConfig> queryWrapper) {
        return super.getOne(queryWrapper);
    }
}
